{include file="public/head"/}
<div class="container-fluid" id="main">
    <div class="row clearfix" id="search-box" style="margin-top:0">
        <div class="col-md-12 column text-right">
            <div class="form-inline" style="text-align: right;">
                <div class="form-group">
                    <input type="text" class="form-control" id="searchText" @keyup.13="requestSearch" name="searchText" placeholder="{:strtoupper(lang('attribute_name'))}">
                  </div>
                  <div class="form-group">
                      <button type="button" class="btn btn-default cz" @click="requestSearch"><span class="glyphicon glyphicon-search"></span> {:strtoupper(lang('search'))}</button>
                  </div>
            </div>
        </div>
    </div>
  <div class="row clearfix">
    <div class="col-md-12 column">
      <div class="alert alert-dismissable alert-info">
        <button type="button" class="close">×</button>
         <p></p>
      </div>
    </div>
   </div>
   
   
  <div class="ntDesktop">
  <div class="ntDesktop-head" v-cloak>{:strtoupper(lang("product_properties"))}</div>
   <input type="hidden" id="langType" value="{$lang|default=''}">
   <div class="row clearfix" style="padding-top:12px">
    <div class="col-md-6 column">
        <ul class="nav nav-tabs" role="tablist">
            <li v-if="isshow_search" class="active">
                <a href="#home" data-toggle="tab" class="ptlang"
                >搜索结果<span class="glyphicon glyphicon-remove shdow" style="margin-left: 10px;" @click="shdow"></span></a>
            </li>
            <li role="presentation" :class="{'active':lang==itemlanguage.code && !isshow_search}" v-for="(itemlanguage,indexlanguage) in language_type">
                <a href="#lang_zh" data-toggle="tab" @click="changefn(itemlanguage.code)">{{itemlanguage.name}}</a>
            </li>
        </ul>
    </div>
    <div class="col-md-6 column text-right">
      <div>
            <a href="/admin/proattr/attrAdd?request=add"  class='btn btn-sm btn-primary' data-toggle="modal" data-target="#proatt_editModal" v-if="auth_ids.indexOf(136) != -1">
              <span class="glyphicon glyphicon-plus"></span> {:strtoupper(lang("add_product_properties"))}
            </a>
            <span style="padding:10px">&nbsp;</span>
            <button type="button" class="btn btn-default option-del" @click="ploption(2)" v-if="auth_ids.indexOf(146) != -1">
                <span class="glyphicon glyphicon-remove-circle"></span> {:strtoupper(lang('batch_delete'))}</button>
            <button type="button" class="btn btn-default option-pulloff" @click="ploption(4)" v-if="auth_ids.indexOf(145) != -1">
                <span class="glyphicon glyphicon-minus-sign"></span> {:strtoupper(lang("delisted_in_bulk"))}123</button>
            <button type="button" class="btn btn-default option-recover" @click="ploption(1)" v-if="auth_ids.indexOf(144) != -1">
                <span class="glyphicon glyphicon-ok-circle"></span> {:strtoupper(lang('batch_recovery'))}</button>
            <button type="button" class="btn btn-danger option-clear" @click="ploption(5)" v-if="auth_ids.indexOf(143) != -1">
                <span class="glyphicon glyphicon-fire"></span> {:strtoupper(lang('batch_clear'))}</button>
        </div>
    </div>
  </div>
  <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="lang_zh"><table class="table table-striped table-hover ntTable">
                <thead>
                <tr>
                    <th style="text-align: center;"><input type="checkbox" @click="allsel" /> </th>
                    <th> {:strtoupper(lang("attribute_name"))} </th>
                    <th> {:strtoupper(lang("attribute_value"))} </th>
                    <th> <a href="#" data-toggle="tooltip" data-placement="top" title="关联产品分类数量">{:strtoupper(lang('product_category_name'))}</a> </th>
                    <th> <a href="#" data-toggle="tooltip" data-placement="top" title="{:strtoupper(lang('related_product_quantity'))}">{:strtoupper(lang("related_product_quantity"))}</a> </th>
                    <th> {:strtoupper(lang('universal'))} </th>
                    <th> {:strtoupper(lang('delete'))} </th>
                    <th> {:strtoupper(lang('status'))} </th>
                    <th style="text-align: center;"> {:strtoupper(lang('operate'))} </th>
                    </tr>
                </thead>
                <tbody>
                  <tr v-for="(item,index) in listdata" :key="item.id+lang" v-cloak>
                    <td style="text-align: center;" class="chebox"><input type="checkbox" @click="onesel(item.id)" /></td>
                    <td>{{item.content}}</td>
                    <td align="left">{{item.childname}}</td>
                    <td >{{item.product_cate}}</td>
                    <td >{{item.cateCount}}</td>
                    <td :style="{color: item.is_public == 'P' ? 'blue' : ''}" >{{item.is_public}}</td>
                    <td :style="{color: item.isdel == 'D' ? 'red' : ''}" >{{item.isdel}}</td>
                    <td >{{item.status_name}}</td>
                    <td class="text-right">
                        <div>
                          <a :href="'/admin/proattr/attrEdit?request=edit&id='+item.id" class='btn btn-sm btn-primary' data-toggle="modal" data-target="#proatt_editModal" v-if="auth_ids.indexOf(137) != -1">
                            <span class="glyphicon glyphicon-pencil"></span> {:strtoupper(lang('edit'))}
                          </a>
                          <a  :href="'/admin/proattr/attrBindType?request=list&id='+item.id" class='btn btn-sm btn-primary' data-toggle="modal" data-target="#proatt2catModal" v-if="auth_ids.indexOf(138) != -1">
                            <span class="glyphicon glyphicon-indent-left"></span> {:strtoupper(lang("specify_product_category"))}</button>
                          <a href="javascript:;" class='btn btn-sm btn-default option-hide' v-if="item.status!='3'" @click="restore(item.id,3,item.content)" v-if="auth_ids.indexOf(142) != -1">
                            <span class="glyphicon glyphicon-eye-close"></span> {:strtoupper(lang('hide'))}</a>
                          <a href="javascript:;" class='btn btn-sm btn-default option-hide' v-if="item.status!='1'" @click="restore(item.id,1,item.content)" v-if="auth_ids.indexOf(188) != -1">
                            <span class="glyphicon glyphicon-eye-close"></span> {:strtoupper(lang('recovery'))}</a>
                          <a href="javascript:;" class='btn btn-sm btn-default option-hide' v-if="item.status!='4'" @click="restore(item.id,4,item.content)" v-if="auth_ids.indexOf(140) != -1">
                            <span class="glyphicon glyphicon-eye-close"></span> {:strtoupper(lang("off_the_shelf"))}</a>
                          <a href="javascript:;" class='btn btn-sm btn-default option-hide' v-if="item.status!='2'" @click="restore(item.id,2,item.content)" v-if="auth_ids.indexOf(141) != -1">
                            <span class="glyphicon glyphicon-eye-close"></span> {:strtoupper(lang('delete'))}</a>
                          <a href="javascript:;" class='btn btn-sm btn-danger option-clear' v-if="item.status=='2'" @click="restore(item.id,5,item.content)" v-if="auth_ids.indexOf(143) != -1">
                            <span class="glyphicon glyphicon-fire"></span> {:strtoupper(lang('clear'))}</a>

                          </div>
                    </td>
                  </tr>
                  <tr style="text-align: center;" v-if="listdata.length==0">
                      <td colspan="9" class="no_date">{:lang('No_data')}</td>
                  </tr>
                </tbody>
              </table>
              <ul class="pagination" id="pagination" v-show="listdata.length!=0">
                </ul>
            </div>
  </div>
</div>
</div>

<div>
    <div class="modal fade" id="proatt_editModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="width:1000px">
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>
<!--详情弹窗部分 开始-->


<div>
    <div class="modal fade" id="proatt2catModal" tabindex="-1" role="dialog" aria-labelledby="ntModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="width:1000px">
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>
<script>
    $("#proatt_editModal").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
        $(".modal-content").children().remove();
        $(document).unbind('keydown')
    });
    $("#proatt2catModal").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
        $(".modal-content").children().remove();
        $(document).unbind('keydown')
    });
</script>


<!--弹窗部分 结束-->
<script src="/static/Admin/js/attrlist.js"></script>
{include file="public/foot"/}